<?php
// +----------------------------------------------------------------------
// | 跃飞 [ 将来的你一定会感激现在奋斗的自己 ]
// +----------------------------------------------------------------------
// | Author: 钟贵廷
// +----------------------------------------------------------------------
// | Author URI: https://git.oschina.net/yeafy
// +----------------------------------------------------------------------
// | weChat:gt845272922  qq:845272922
// +----------------------------------------------------------------------

namespace app\yeafy\simpleFactory\demo1;


class ProductFactory
{
       public static function getInstance($type)
       {
           switch ($type)
           {
               case 1:
                   return new Infantry(); //步兵
               break;
               case 2:
                   return new Cavalry(); //骑兵
               break;
               default:
                   return null;
           }
       }
}